/*
 * traffic_light.c
 *
 *  Created on: 29.05.2011
 *      Author: tobias
 */

#include "ses/ses_scheduler.h"
#include "ses/ses_led.h"

void tl_start();
void tl_phase();

int main(){

	scheduler_init();
	scheduler_add(tl_start, 0);
	scheduler_run();

	return 0;
}

void tl_start(){
	led_redInit();
	led_yellowInit();
	led_greenInit();
	scheduler_add(tl_phase, 0);
}

void tl_phase(){
	scheduler_add(led_greenOn, 0);
	scheduler_add(led_greenOff, 5000);
	scheduler_add(led_yellowOn, 5000);
	scheduler_add(led_yellowOff, 5500);
	scheduler_add(led_redOn, 5500);
	scheduler_add(led_yellowOn, 7500);
	scheduler_add(led_redOff, 7800);
	scheduler_add(led_yellowOff, 7800);
	scheduler_add(tl_phase, 7801);
}
